import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import Home from "@/views/home/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "root",
    component: Layout,
    redirect: { name: "Home" },
    children: [
      {
        path: "home",
        name: "Home",
        component: Home,
        meta: {
          title: "宣传"
        },
        children: [
        ]
      },
      {
        path: "/detail/:id/:type",
        name: "Detail",
        component: () => import("@/views/home/detail.vue"),
        meta: {
          title: "宣传详情"
        }
      },
      {
        path: "info",
        name: "Info",
        component: () => import("@/views/info/index.vue"),
        meta: {
          title: "信息公开"
        }
      },
      {
        path: "/info-detail/:id/:type",
        name: "InfoDetail",
        component: () => import("@/views/info/info-detail.vue"),
        meta: {
          title: "信息详情"
        }
      },
      {
        path: "zhufang",
        name: "Zhufang",
        component: () => import("@/views/zhufang/index.vue"),
        meta: {
          title: "住房保障"
        },
        children: [
        ]
      },
      {
        path: "/zhufang-detail/:id/:type",
        name: "ZhufangDetail",
        component: () => import("@/views/zhufang/detail.vue"),
        meta: {
          title: "住房保障详情"
        }
      },
      {
        path: "question",
        name: "Question",
        component: () => import("@/views/question/index.vue"),
        meta: {
          title: "问题反馈"
        }
      },
      {
        path: "check",
        name: "Check",
        component: () => import("@/views/question/check.vue"),
        meta: {
          title: "问题查询"
        }
      },
      {
        path: "chatAI",
        name: "ChatAI",
        component: () => import("@/views/chatAI/index.vue"),
        meta: {
          title: "AI智询",
          noCache: true
        }
      },
      {
        path: "about",
        name: "About",
        component: () => import("@/views/about/index.vue"),
        meta: {
          title: "关于",
          noCache: true
        }
      }
    ]
  }
];

export default routes;
